/*
 * @: 
 * @version: 1.0
 * @Author: ziwei
 * @Date: 2021-10-24 15:35:18
 * @LastEditors: ziwei
 * @LastEditTime: 2021-11-01 10:39:22
 */
function combineReducers(reducers){
    //state 老的总状态
    //action 动作
    return function(state={},action){
        let nextState = {}
        for(let key in reducers){
            console.log(state[key],action,reducers);
            nextState[key] = reducers[key](state[key],action);
        }
        console.log(nextState);
        return nextState
    }
}

export default combineReducers;